<?php
namespace app\api\controller\v1;
use app\api\controller\Common;

class OrderClient extends Common{
	var $modelDb;
	public function _initialize(){
		parent::_initialize();
		$this->modelDb = model("OrderClient");
	}
	public function order_add(){
		$ids = $this->modelDb->save_datas($this->postData, $this->uinfo['userid']);
		if ($ids === false) {
			return $this->app_error($this->modelDb->getError());
		}
		return $this->app_success();
	}
	public function order_update(){
		$ids = $this->modelDb->update_datas($this->postData, $this->uinfo['userid']);
		if ($ids === false) {
			return $this->app_error($this->modelDb->getError());
		}
		return $this->app_success();
	}
	public function del_order(){
		$ids = $this->modelDb->where('id', $this->postData['id'])->setField('isdel', 1);
		if ($ids === false) {
			return $this->app_error($this->modelDb->getError());
		}
		return $this->app_success();
	}
}